/* 包含多个基于state的getter计算属性的对象 */
export default{
    totalCount(state){
        return state.cartFoods.reduce((pre,next)=>{
            return pre+next.count
        },0)
    },
    totalPrice(state){
        return state.cartFoods.reduce((pre,next)=>{
            return pre+next.count*next.price
        },0)
    },
    positive(state){
        return state.ratings.reduce((pre,next)=>{
            return pre+(next.rateType===0?1:0)
        },0)
    }
}